<!DOCTYPE html>
<html>

<head>
    <title>融享红包</title>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${ctxPath}/assets/common/libs/layui/css/layui.css?v=${constants.getReleaseVersion()}"/>
    <link rel="stylesheet" href="${ctxPath}/assets/demos/css/gift.css?v=${constants.getReleaseVersion()}" media="all">
    <style>
        body {
            background-image: url("${ctxPath}/assets/imgs/gift.jpg");
            background-repeat: no-repeat;
            background-size: 100% 100%;
            background-color: #f0f2f5;
        }


		.active-rules{
			position: absolute;
			right:0px;
			top:50px;
			height:40px;
			width:100px;
			
			background-image: url("${ctxPath}/assets/imgs/btn_hdgz.png");
		    background-repeat: no-repeat;
		    background-size: 100% 100%;
		}
		
		.wx-share{
			position: absolute;
			right:0px;
			top:90px;
			
			height:65px;
			width:110px;
			
			background-image: url("${ctxPath}/assets/imgs/btn_share.png");
		    background-repeat: no-repeat;
		    background-size: 100% 100%;
		}
		
		.get-hongbao{
			position: absolute;
			width:70%;
			height:50px;
			left:15%;
			bottom:10%;
			text-align: center;
			
			background-image: url("${ctxPath}/assets/imgs/btn_lqhb.png");
		    background-repeat: no-repeat;
		    background-size: 100% 100%;
		    z-index:800;
		}

		.hdgz-dlg{
			display:block;
			width:100%;
			height:100%;
			background-color: rgba(0, 0, 0, .75);
			z-index:1000;
		}
		
		.hdgz-dlg.hide{
			display:none;
		}
		
		.hdgz-dlg-body{
			position: absolute;
			top: 25%;
			left: 15%;
			width:70%;
			height:50%;
			
			background-image: url("${ctxPath}/assets/imgs/bg_hdgz.jpg");
		    background-repeat: no-repeat;
		    background-size: 100% 100%;
		    background-color: #f0f2f5;
		    
		    border-radius:5px;
		}
		
		.hdgz-text{
			position: relative;
			top: 25%;
			left: 10%;
			width:80%;
			height:70%;
			background-color: #fafafa;
			
			overflow-y:auto;
			border-radius:3px;
		}
		
		.hdgz-text::-webkit-scrollbar {
			display: none;
		}
		
		.hdgz-dlg-colse{
			position: absolute;
			bottom: 15%;
			width:40px;
			height:40px;
			
			left:45%;
			
			background-image: url("${ctxPath}/assets/imgs/btn_close.png");
		    background-repeat: no-repeat;
		    background-size: 100% 100%;
		}

		.hdgz-cp-book{
			position: relative;
			padding-left:15px;
			left:-10px;
			margin-top:10px;
			height:36px;
			line-height:36px;
			width:80px;
			background-image: url("${ctxPath}/assets/imgs/label.png");
		    background-repeat: no-repeat;
		    background-size: 100% 100%;
		    color:red;
		    font-size:12px;
		    z-index:1009;
		}
		
		.hdgz-cp p{
			position: relative;
			text-indent:20px;
			font-size:12px;
		}
		
		.code-dlg {
			position: absolute;
			left:0px;
			top:0px;
			height:100%;
			width:100%;
			
			display:block;
			background-color: rgba(0, 0, 0, .75);
			z-index:1000;
			
			background-image: url("${ctxPath}/assets/imgs/dlg_code.png");
		    background-repeat: no-repeat;
		    background-size: 100% 100%;
		}
		.code-dlg.hide{
			display:none;
		}
		
		.code-dlg .hb-code-area{
			position: absolute;
			background-color: #ef5350;
			border-radius:5px;
			top:45%;
			left: 25%;
			width:50%;
			height:80px;
			line-height:40px;
			color:#fafafa;
			text-align:center;
		}
		
		.code-dlg .hb-code-area .code-text {
			color:#f57c00;
			background-color: #fafafa;
			border-radius:5px;
			letter-spacing:3px;
		}
		
		.hdcode-dlg-colse{
			position: absolute;
			bottom: 20%;
			width:40px;
			height:40px;
			
			left:45%;
			
			background-image: url("${ctxPath}/assets/imgs/btn_close.png");
		    background-repeat: no-repeat;
		    background-size: 100% 100%;
		}
		
		
        .login-header {
            color: rgba(0, 0, 0, .85) !important;
        }

        .login-footer {
            color: rgba(0, 0, 0, 0.7) !important;
        }

        .login-footer a {
            color: rgba(0, 0, 0, 0.7) !important;
        }

        .login-footer a:hover {
            color: rgba(0, 0, 0, 0.4) !important;
        }
    </style>
    <script>
        if (window != top)
            top.location.replace(location.href);
    </script>
</head>

<body>



<div class="login-wrapper">

	 <div class="active-rules">
	 </div>
	 
	 <div class="wx-share">
	 </div>

	 <div class="get-hongbao">
	 </div>
 
</div>

<div class="hdgz-dlg hide">
	
	<div class="hdgz-dlg-body">
		<div class="hdgz-text">
			<div class="hdgz-cp 1">
				<div class="hdgz-cp-book">
					活动名称
				</div>
				<p>签约三方存管有礼</p>
			</div>
			<div class="hdgz-cp 2">
				<div class="hdgz-cp-book">
					活动对象
				</div>
				<p>新签约三方存管业务的江苏银行用户</p>
			</div>
			<div class="hdgz-cp 3">
				<div class="hdgz-cp-book">
					活动内容
				</div>
				<p>活动期间，所有新签约指定券商三方存管业务、且做一笔银证转账的我行客户，即可获得一次红包抽奖的机会。</p>
			</div>
			<div class="hdgz-cp 4">
				<div class="hdgz-cp-book">
					其他说明
				</div>
				<p>鉴于物联网之特殊性，活动期间如发生黑客攻击、电信部门技术调整导致重大影响、病毒侵袭、网络故障、微信平台、宽带、域名解析故障或其他网络设备或技术提供商的服务延迟、服务障碍或任何其他类似事件、导致活动无法正常进行，在法律法规运行范围内江苏银行不承担相关责任。</p>
				<p>由于用户自身参与活动方式不当或不正确导致不能参与活动，在法律法规允许范围内江苏银行不承担相关责任。</p>
				<p>本活动最终解释权归江苏银行所有。</p>
			</div>
		</div>
	</div>
	
	<div class="hdgz-dlg-colse">
	
	</div>
</div>

<div class="code-dlg hide">
	<div class="hb-code-area">
		<p class="code-title" >你的红包口令:</p>
		<p class="code-text" ><span class="hb-code-text"></span></p>
	</div>
	<div class="hdcode-dlg-colse">
	
	</div>
</div>


@/* 加入contextPath属性和session超时的配置 */
<script type="text/javascript">
    var Feng = {
        ctxPath: "${ctxPath}",
        version: '${constants.getReleaseVersion()}'
    };
</script>



<script type="text/javascript" src="${ctxPath}/assets/common/libs/layui/layui.js?v=${constants.getReleaseVersion()}"></script>
<script type="text/javascript" src="${ctxPath}/assets/common/js/common.js?v=${constants.getReleaseVersion()}"></script>

<script>
	var $ = null;
    layui.use(['layer'], function () {
    	$ = layui.jquery;
    });
</script>

<script type="text/javascript" src="${ctxPath}/assets/demos/app/jsbridge-1.0.4.js?v=${constants.getReleaseVersion()}"></script>
<script type="text/javascript" src="${ctxPath}/assets/demos/app/thirdPayAll.js?v=${constants.getReleaseVersion()}"></script>

<!-- 
<script type="text/javascript" src="http://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
 -->


<script>
    layui.use(['layer', 'form', 'index', 'ax'], function () {
    	
        var $ax = layui.ax;
        var layer = layui.layer;
        var form = layui.form;
        var index = layui.index;

        
        var userId = null;
        var pt = null;
        
        //userId = 1000009;
        
        var funs = {};
        var hbVerCodes= null;
        var getGotCodeRsped = false;
        
        
        funs.getUrlRawParam = function (name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) {
                return r[2];
            } else {
                return null;
            }
        };
        
        var zhParam = funs.getUrlRawParam("param");
  		console.log("param:"+zhParam);
        
  		
  		//var text = $(".hdgz-cp-book").html();
  		//console.log("text:"+text);
  		
  		
  		
        //zhParam = "avYYq7DDt%2BeUwx8J2%2B6%2FFqorq9Fb2c85JqHIPhJPUGn%2BOX7scF30QAqT395gCdpk";
      
        
        funs.decZhParam = function(){
        	if(zhParam==null || zhParam == undefined){
        		
        		layer.msg("参数获取失败", {icon: 5, anim: 6});
        		return;
        	}
        	
        	var ajax = new $ax(Feng.ctxPath + "/mappApi/decZhParam", function (res) {
        		 console.log(res);
         		 if(res.code ==200){
         			userId = res.data.coreCustNo;
         			pt = res.data.pt;
         		 }else{
         			 layer.msg("用户信息验证失败", {icon: 5, anim: 6});
         		 }
                 // Feng.success("登录成功!");
              }, function (data) {
                  layer.msg("用户信息验证失败" + data.message, {icon: 5, anim: 6});
              });
         	 
         	
         	 ajax.set("param", zhParam);
         	 ajax.start();
        }
        
        funs.decZhParam();
        
        funs.showGotCode = function(code){
        	$(".hb-code-text").html(code);
        	$(".code-dlg").removeClass("hide");
        }
      
        $(".hdcode-dlg-colse").click(function(){
        	$(".code-dlg").addClass("hide");
        	
        	//$(".login-wrapper").removeClass("hide");
        });
        
        funs.getGotCode = function(s_func){
        	
          	 var ajax = new $ax(Feng.ctxPath + "/mappApi/getGotCode", function (res) {
        		 getGotCodeRsped = true;
          		 console.log(res);
          		 if(res.code ==200){
   					 
          			 if(res.data == null || res.data == undefined || res.data.length < 1 ){
          				 //跳转页面
          				 if(s_func!=null && s_func != undefined)
          				 	s_func();
          			 }else{
          				 hbVerCodes = res.data;
          				 funs.showGotCode(res.data[0].vcode);
          				//layer.msg("已经领取，只有一次领取机会", {icon: 5, anim: 6});
          			 }
          		 }else{
          			 layer.msg("获取失败！" + data.message, {icon: 5, anim: 6});
          		 }
                  // Feng.success("登录成功!");
               }, function (data) {
                   layer.msg("获取失败！" + data.message, {icon: 5, anim: 6});
               });
          	 
          	 if(userId!=undefined){
          	  	 ajax.set("userId", userId);
          	 }
          	 ajax.start();
        }
        
        funs.getGotCode();
        
        funs.goVerCodePage = function(){
        	 window.location.href = Feng.ctxPath + "/mappApi/hbVerCode?param="+zhParam;
        }
        
        
        $(".active-rules").click(function(){
        	$(".hdgz-dlg").removeClass("hide");
        	
        	$(".login-wrapper").addClass("hide");
        	
        });
        $(".hdgz-dlg-colse").click(function(){
        	$(".hdgz-dlg").addClass("hide");
        	
        	$(".login-wrapper").removeClass("hide");
        });
        
        
        
        $(".wx-share").click(function(){
        	  
        	//layer.msg("点击右上角分享到朋友圈");
        	
        	 //微信分享 content-分享文字内容  url-地址url imgUrl-图片Url
        	var txt = "银证 见面有礼";
        	var url = "https://www.dogroot.com/wxConsole/assets/imgs/toShare.jpg";
        	var imgUrl = "https://www.dogroot.com/wxConsole/assets/imgs/toShare.jpg";
        	
            ThirdApp.wxShare(txt,url,imgUrl);
      	 
        });
        
        
        $(".get-hongbao").click(function(){
        	/**/
        	  if(userId==undefined || userId == null){
        		  layer.msg("用户信息异常");
        		  return;
              }
        	  
        	  if(getGotCodeRsped == false){
        		  return;
        	  }
        	  
        	  if(hbVerCodes!=null){
        		  funs.showGotCode(hbVerCodes[0].vcode);
        		  return;
        	  }
        	  
        	  funs.goVerCodePage();
        	  
        	  //历史记录已经响应
          });
        
        
       
        
        /* 初始化jssdk 分享功能 */
        var configWxShare = function(){
       		 var ajax = new $ax(Feng.ctxPath + "/mappApi/wxsConfig", function (res) {
       		 
       		 console.log(res);
       		 if(res.code ==200){
       			wx.config({
       				debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
       				appId: res.data.appId, // 必填，公众号的唯一标识
       				timestamp: res.data.timestamp, // 必填，生成签名的时间戳
       				nonceStr: res.data.nonceStr, // 必填，生成签名的随机串
       				signature: res.data.signature,// 必填，签名，见附录1
       				jsApiList: ['checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
       			}); 
       			
	       		 wx.ready(function(){
	      			//layer.msg("jssdk初始化成功");
	      	    	// config信息验证后会执行ready方法，所有接口调用都必须在config接口获得结果之后，config是一个客户端的异步操作，
	      	    	//所以如果需要在页面加载时就调用相关接口，则须把相关接口放在ready函数中调用来确保正确执行。
	      	    	//对于用户触发时才调用的接口，则可以直接调用，不需要放在ready函数中。
	      	    	//
	      	    	var shareData = { 
	      		    	title: '银证 见面有礼', 
	      		    	link: 'https://www.dogroot.com/wxConsole/assets/imgs/toShare.jpg', // 分享域名要和当前域名保持一致！！
	      		    	imgUrl: 'https://www.dogroot.com/wxConsole/assets/imgs/gift.jpg', 
	      		    	success: function (res) { 
	      		    		alert('已分享'); 
	      		    	}, 
	      		    	cancel: function (res) { 
	      		    		alert('已取消'); 
	      		    	}, 
	      		    	fail: function (res) { 
	      		    		alert(JSON.stringify(res)); 
	      		    	} 
	      	    	}; 
	      	
	      	    	//<%--分享给朋友接口--%> 
	      	    	wx.onMenuShareAppMessage(shareData);
	      	    	//<%--分享到朋友圈接口--%> 
	      	    	wx.onMenuShareTimeline(shareData); 
	      	    	//<%--分享到QQ朋友接口--%> 
	      	    	//wx.onMenuShareQQ(shareData); 
	            });
	            
	            wx.error(function(res){
	         	   console.log(res);
	         	   //layer.msg();
	            });
       			 
       		 }else{
       			 
       			// layer.msg(res.message, {icon: 5, anim: 6});
       		 }
            }, function (data) {
               // layer.msg("获取失败！" + data.message, {icon: 5, anim: 6});
            });
       	 
       	 
       	    ajax.set("url", window.location.href);
       	
       	 	ajax.start();
       }
        
      // configWxShare();

    });
</script>


</body>
</html>